CC PrestaShop Watermark Documentation
Comprehensive documentation for watermark module for PrestaShop (cc_ps_watermark) with advanced backup system, automatic thumbnail regeneration and detailed watermark management.Table of contents
- Introduction
- Installation
- License activation
- Management panel
- General settings
- Watermark configuration
- Backup system
- Regeneration of miniatures
- Log management
- CRON and automation
- Font management
- Troubleshooting
- FAQ
1. introduction
CC PrestaShop Watermark is an advanced module that allows you to automatically add watermarks to all product thumbnails in your PrestaShop store. The module offers a comprehensive system for protecting original images through automatic backups and advanced tools for managing the image watermarking process.Main functions of the module:
- Adding text and image watermarks
- Automatic backup system of original images
- Regeneration of all thumbnails with watermarking
- Support for custom TTF fonts
- Selective processing of thumbnail types
- Detailed system of logging activities
- CRON for automatic regeneration
- Restore original images from backups
- Multilingual administrative interface
- License system with full functionality
2 Installation
System requirements- PrestaShop 1.7.0.0 or later
- PHP 7.2 or later
- MySQL 5.6 or later
- GD extension for PHP (for image handling).
- Write permissions on img/ and modules/ directories
- Minimum 512 MB RAM (1 GB recommended for large stores)
- Imagettftext functions for TTF font support
- Download the ZIP file of the module from the official store cocos.codes
- Log in to your PrestaShop admin panel
- Go to: Modules > Module Manager > Add New Module
- Click "Add Module" and select the downloaded ZIP file
- When the installation is complete, click "Configure"
- The module will automatically create directories: backups/, uploads/, fonts/.
Info
After installation, the module will automatically create the necessary database tables (cc_ps_watermark_log, cc_ps_watermark_backups, cc_ps_watermark_processed), directories for backups and set the default configuration. Before starting work, we recommend activating the license and adding TTF fonts to the fonts/ directory.
3. license activation
It is necessary to activate the license before using the full functionality of the module:- After installation, go to configure the module
- Select the "License" tab
- Enter the license key you received after purchase
- Click "Activate License"
- After successful activation, you will see a confirmation message
- All functions of the module will be unlocked
Warning
Without an active license, the module will work in limited mode - AJAX functions will be blocked, and a message about an inactive license will be displayed at the top of the administration panel. Basic functions for adding watermarks will be available, but without advanced management options.
4. management panel
The module's management panel consists of several tabs that allow full configuration and management:Main tabs:
- Settings - main module configuration, watermark styling
- Regeneration of miniatures - image regeneration tools with CRON
- Backups - managing backups of original images
- Logs - history of module activities with filtering system
- Documentation - link to online documentation
- Support - link to support page
- Plugins - additional COCOS extensions
- License - module license management
5. general settings
In the general settings section you will find the basic options that control the operation of the module:Setup | Description | Default value |
Enable the module | Global module enable/disable | Turned off |
Enable backups | Automatic creation of copies of original images | Enabled |
- Module on - watermarks are automatically added to new and updated products
- Module disabled - watermarks are not added, but existing ones remain intact
- Backups enabled - a copy of the original is created before each image modification
- Backups disabled - images are modified directly without copies
Tip
We recommend leaving backups on so you can restore the original images if necessary. Use the module's main switch for quick shutdown during maintenance work.
6. watermark configuration
The module offers two main types of watermarks with extensive configuration of each:Watermark type
There are two options for tagging images:
Type | Description | Requirements |
Text | Text watermark with font and color configuration | Optional TTF font |
Image | Image watermark with transparency support | PNG/JPG/GIF file |
Text character configuration
- Watermark text - content to be displayed (default: "COCOS.CODES")
- Font TTF - selection from the available fonts in the fonts/ directory.
- Font size - From 8 to 200 pixels (default: 24px)
- Text color - color selection in HEX format (default: #FFFFFFFF)
- Image file - PNG file upload with transparency
- A preview of the current - displaying the currently used image
- Maximum size - 2MB per file
- Supported formats - PNG, JPG, JPEG, GIF
- Watermark position - 9 positions to choose from (corners, centers, center)
- Repeat watermark - duplication over the entire image
- Transparency - From 0% (invisible) to 100% (opaque)
We can choose which types of thumbnails to mark:
- List of all available product image types
- Display resolution of any type
- Ability to choose any combination
- Default: all types are marked
Note
If you do not select any thumbnail type, the module will mark all available types. Changing the settings applies only to newly processed images - use the regenerate function to update existing ones.
7. backup system
One of the most important elements of the module - a comprehensive system for securing original images:Automatic creation of copies
The system automatically creates backups:
- Before adding a watermark to an image for the first time
- For each type of miniature separately
- Preserving the original directory structure
- With metadata in the database
The panel displays useful information:
- Total number of backups - all backups created
- Backup products - number of products with protected images
- Disk occupancy - total size of all copies
- Last backup - date of latest backup
Available operations on backups:
Operation | Description | Comments |
Restore all copies | Restores original images from all copies | Removes watermarks from the entire store |
Delete all copies | Permanently removes all copies from disk | Irreversible surgery |
Restore copies of the product | Restores images of only the selected product | Available for each product separately |
A detailed table including:
- Product ID and name
- Number of backups
- Size of space occupied
- Date of last backup
- Restore button for each product
The system has been optimized for performance:
- 20 products per page
- Efficient loading of large lists
- AJAX for copy operations
- Automatic refresh of statistics
Warning
Operations on backups are irreversible. Restoring a copy removes watermarks, and deleting a copy makes it impossible to restore the original images. We recommend backing up your entire store before major operations.
8. regeneration of miniatures
An advanced regeneration system makes it possible to apply watermarks to existing images:Manual regeneration
Immediate processing of all thumbnails:
- "Regenerate thumbnails now" button.
- Confirmation before the start of operations
- Progress bar with status information
- Success or error messages
The system allows you to schedule automatic regeneration:
0 2 * * * /usr/bin/php /path/to/prestashop/modules/cc_ps_watermark/cron.php
CRON file
The module includes a dedicated cron.php file offering:
- Checking if the module is active
- Set time and memory limits
- Exactly the same functionality as the button in the panel
- Logging the results into the console
- Multilingual error messages
Alternatively, you can use CRON over HTTP:
http://twoja-domena.pl/modules/cc_ps_watermark/cron.php?token=WYGENEROWANY_TOKEN
The regeneration system has been optimized:
- Processing in batches of 10 products
- Automatic memory release
- Support for time limits (10 minutes for CRON)
- Increase the memory limit to 512MB
Tip
We recommend regenerating during the hours of least store traffic. For large stores (>1000 products), use CRON instead of manual regeneration by browser.
9. log management
A comprehensive logging system tracks all module activities:Types of events logged
The system records the following actions:
Action | Description | Additional information |
process_image | Single image processing | File path, status, errors |
create_backup | Backup | Backup location |
restore_backup | Restore from a copy | Restored file |
regenerate_all | Regeneration of all miniatures | Number of images processed |
process_product | Product processing | Product ID, number of images |
Each entry includes:
- Log ID - unique identifier of the entry
- Date and time - exact timestamp of operation
- Action - type of operation performed
- Product ID - related product (if applicable)
- Status - success, warning, error, info
- Message - detailed description of the incident
Available features:
- Pagination - 50 entries per page
- Sorting - latest entries at the top
- Cleaning the logs - deletion of all entries
- Automatic rotation - maximum 5000 entries
Visual indication of validity:
- success - green (operation successfully completed)
- warning - Yellow (warnings, partial errors)
- error - red (critical errors)
- info - blue (general information)
Info
The system automatically maintains a maximum of 5,000 log entries. Older entries are automatically deleted. To maintain a complete history, we recommend periodically exporting logs from the database.
10. CRON and automation
Detailed information about module process automation:Server configuration
To set up automatic regeneration on the server:
- Log in to cPanel/Plesk or via SSH
- Find the "CRON Jobs" or "Cron Jobs" section.
- Add a new task with the command given in the module panel
- Set the frequency as needed (recommended: every night)
- Check that the path to PHP is correct
Depending on the server, the path may be different:
/usr/bin/php
/usr/local/bin/php
/opt/php/bin/php
php (if it is in the PATH)
Different regeneration frequencies:
Schedule | Description | CRON command |
Every day at 2:00 a.m. | Recommended for most stores | 0 2 * * * |
Every week on Sunday | For stores with infrequent changes | 0 2 * * 0 |
Every 6 hours | For stores that are updated frequently | 0 */6 * * * |
Every month | Minimum frequency | 0 2 1 * * |
To verify that CRON is working properly:
- Check module logs after scheduled execution time
- Test manually calling cron.php through a browser
- Check server logs for PHP errors
- Make sure the module is active
The cron.php file contains security features:
- Module activity check
- Token validation for HTTP access
- Logging of all operations
- Graceful error handling
Note
The token for the CRON URL is automatically generated based on PrestaShop configuration and provides basic security. For increased security, we recommend using CRON via command line instead of HTTP.
11. font management
TTF custom font support system for text watermarks:Catalog of fonts
TTF fonts should be placed in the directory:
/modules/cc_ps_watermark/fonts/
The module supports only TTF (TrueType Font) fonts:
- Extension: .ttf
- Checking for the existence of a file before use
- Automatic detection of available fonts
- Friendly names based on file names
Suggested fonts to use:
Font | Description | Best use |
Roboto-Regular.ttf | Default, modern, readable | Universal application |
Arial-Bold.ttf | Bold, distinctive | Clear watermarks |
OpenSans-Light.ttf | Lightweight, elegant | Subtle watermarks |
Impact.ttf | Wide, strong | Protection against piracy |
System automatically:
- Scans fonts/ directory for TTF files
- Generates friendly names (e.g., "Roboto Regular" from "Roboto-Regular.ttf")
- Checks the availability of the imagettftext function
- Provides fallback to embedded fonts
The panel reports on the status of fonts:
- No fonts - warning about empty fonts/ directory
- List of available - selection from detected TTF fonts
- Font does not exist - validation error when saving
If the TTF font is not available, the module uses:
- Built-in GD font (size 5 - the largest available)
- Automatic recalculation of text position
- Preservation of all other settings
Tip
To add a new font, simply upload the TTF file to the fonts/ directory and refresh the configuration page. The font will automatically appear in the selection list. We recommend using fonts with a license that allows commercial use.
12 Troubleshooting
Watermarks are not added to new products- Check if the module is enabled in the general settings
- Make sure the license is active
- Check that the correct thumbnail types are selected
- Verify that the GD extension is installed
- Check write permissions on img/ directories.
- Check PHP memory limits (recommended: min. 512MB)
- Increase max_execution_time in PHP (recommended: 300 seconds)
- Check that all product images are correct
- Use CRON instead of browser for large stores
- Check module logs for error details
- Check write permissions on the modules/cc_ps_watermark/backups/ directory
- Make sure there is enough space on the disk
- Check that the backups/ directory was created during installation
- Verify the integrity of the database (table cc_ps_watermark_backups)
- Check module logs for errors related to backups
- Check that the path to PHP in CRON is correct
- Verify permissions to the cron.php file (755)
- Make sure that the module is active during CRON execution
- Check server logs for errors
- Test the execution of cron.php manually via SSH
- Check if the GD extension has TTF support (imagettftext function)
- Make sure that the font files have a .ttf extension
- Verify permissions to read font files (644)
- Check that the font path is correct
- Check that the font file is not corrupted
- Check the size of your backups under "Backups"
- Consider deleting old backups
- Optimize product images before adding watermarks
- Use image compression in PrestaShop settings
- Regularly clean up unnecessary backups
Error
If you encounter unsolvable problems with the module, make sure you are using the latest version and that your PrestaShop store is up-to-date. Also check if you have sufficient server resources (RAM, CPU, disk space). In case of difficulties, contact COCOS support via the website. cocos.codes/support.
13 FAQS.
Can I restore the original images after adding watermarks?Yes, if you have backups enabled. Use the "Restore all backups" function in the "Backups" tab or restore backups for a specific product.
How often should I regenerate my thumbnails?
It depends on the frequency of adding products. For active stores, we recommend daily regeneration by CRON. For less active - weekly or as needed.
Can I use my own TTF fonts?
Yes, drop the TTF files into the /modules/cc_ps_watermark/fonts/ directory and they will automatically appear in the selection list. Make sure you have the right to use the fonts commercially.
What happens if I disable backups?
Images will be modified directly without the ability to restore the original versions. We do not recommend disabling this option.
Can I add a watermark only to certain types of thumbnails?
Yes, in the settings you can select specific types of thumbnails to be marked. Unselected types will remain unchanged.
How to check if CRON is working properly?
Check the "Logs" tab after the scheduled CRON execution time. Regeneration entries should appear. You can also test the cron.php call manually.
Can I change the watermark position for different types of thumbnails?
Currently, the position is global for all types of thumbnails. Separate positions for different types require code modification.
What image formats are supported for watermarking?
PNG, JPG, JPEG and GIF formats are supported. We recommend PNG with transparency for best results.
Can I use the module on a store with thousands of products?
Yes, but we recommend using CRON to regenerate and monitor server resources. Large stores may need to increase PHP limits.
What does "The image already has a watermark" mean in the logs?
The system keeps track of which images have already been processed and does not add the watermark again. This is normal behavior to prevent duplicate marks.
Can I export the module logs?
Currently there is no built-in export function, but all logs are in the cc_ps_watermark_log table and can be exported via phpMyAdmin.
How to remove all watermarks from the store?
Use the "Restore all copies" function in the "Backups" tab. This will restore the original images from all backups.
Does the module affect the performance of the store?
During normal operation, the impact is minimal. Image processing only occurs when adding/updating products or during regeneration.
What happens when the license expires?
Basic features will work, but advanced options like AJAX, backups and regeneration may be limited. We recommend renewing your license.
Can I use the module on a test environment?
Yes, the license also allows use on test subdomains and local development environments according to the terms of the license.
How big font files can I use?
There is no hard limit, but we recommend fonts up to 2MB. Larger files may affect performance when processing images.
Can I use emoji or special characters in watermark text?
Yes, if the TTF font used supports the characters in question. GD's built-in fonts have limited support for special characters.
What does the error "GD extension is not available" mean?
This means that the GD extension for PHP, which is required for image processing, is not installed on the server. Contact your server administrator.
Can I automatically add watermarks to images uploaded via FTP?
The module automatically processes images only for operations through the PrestaShop panel. Images added via FTP require regeneration of thumbnails.
How to change the maximum size of the uploaded watermark image?
The 2MB limit is defined in the ImageHelper class. The change requires modifying the code and increasing the PHP upload_max_filesize limits.
Success
CC PrestaShop Watermark module is a professional tool for protecting product images in online stores. With advanced backup system, process automation and detailed logging system, it provides secure and effective watermark management on all product images.